<%= stylesheet_link_tag 'default' %>
<div id="wrapper">
<div id="wrapper-btm">
<div id="page">

	<div id="content">
		<div id="banner">&nbsp;</div>
			<% @dinnermoments.each do |dinnermoment|%>
	
				<h2> Eetmoment <%= dinnermoment.date%> </h2>
	
				<table>
					<tr>
						<th>Naam</th>
						<th>Kok</th>
						<th>Te betalen/ontvangen</th>
					</tr>
					<% dinnermoment.eaters.each do |eater|%>
					<tr>
						<td><%= eater.user.name %></td>
						<td><% if dinnermoment.kook == eater.user_id %>
							 	true
							<% end %>
						<td><%= dinnermoment.kook ? dinnermoment.cost : dinnermoment.cost/dinnermoment.eaters.size %>
					</tr>
			<% end %>
			</table>
	
			<b>Totale kosten: <%= dinnermoment.cost %> euro</b>
			<% end %>

			<h1>Totaal te betalen</h1>
			<table>
				<tr>
					<th>Naam</th>
					<th>Betalen</th>
				</tr>
				<% @users.each do |user|%>
					<tr>
						<td><%= user.name %></td>
						<td><%= @costs[user.id-1].round(2) %></td>
					<tr>
				<% end %>

			</table>
	</div>
</div>

<div id="sidebar">

	<%= link_to "Terug naar de homepage", dinnermoments_path%>

</div>
<div style="clear: both;">&nbsp;</div>
</div>
</div>
</div>
